package com.avamanager.app.service.impl;

import java.util.List;
import com.avamanager.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.avamanager.app.mapper.AppCourseMapper;
import com.avamanager.app.domain.AppCourse;
import com.avamanager.app.service.IAppCourseService;

/**
 * 课程信息Service业务层处理
 * 
 * @author FenvyYe
 * @date 2022-08-15
 */
@Service
public class AppCourseServiceImpl implements IAppCourseService 
{
    @Autowired
    private AppCourseMapper appCourseMapper;

    /**
     * 查询课程信息
     * 
     * @param courseId 课程信息主键
     * @return 课程信息
     */
    @Override
    public AppCourse selectAppCourseByCourseId(Long courseId)
    {
        return appCourseMapper.selectAppCourseByCourseId(courseId);
    }

    /**
     * 查询课程信息列表
     * 
     * @param appCourse 课程信息
     * @return 课程信息
     */
    @Override
    public List<AppCourse> selectAppCourseList(AppCourse appCourse)
    {
        return appCourseMapper.selectAppCourseList(appCourse);
    }

    /**
     * 新增课程信息
     * 
     * @param appCourse 课程信息
     * @return 结果
     */
    @Override
    public int insertAppCourse(AppCourse appCourse)
    {
        appCourse.setCreateTime(DateUtils.getNowDate());
        return appCourseMapper.insertAppCourse(appCourse);
    }

    /**
     * 修改课程信息
     * 
     * @param appCourse 课程信息
     * @return 结果
     */
    @Override
    public int updateAppCourse(AppCourse appCourse)
    {
        appCourse.setUpdateTime(DateUtils.getNowDate());
        return appCourseMapper.updateAppCourse(appCourse);
    }

    /**
     * 批量删除课程信息
     * 
     * @param courseIds 需要删除的课程信息主键
     * @return 结果
     */
    @Override
    public int deleteAppCourseByCourseIds(Long[] courseIds)
    {
        return appCourseMapper.deleteAppCourseByCourseIds(courseIds);
    }

    /**
     * 删除课程信息信息
     * 
     * @param courseId 课程信息主键
     * @return 结果
     */
    @Override
    public int deleteAppCourseByCourseId(Long courseId)
    {
        return appCourseMapper.deleteAppCourseByCourseId(courseId);
    }
}
